package com.kevin.ymqquan.activity;

import com.kevin.ymqquan.R;
import com.kevin.ymqquan.custom.CustomToast;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class MyClubDetailActivity extends Activity {
	
	
	private String isJoin;
	private String clubId;
	
	private TextView tv_club_detail_name;
	private TextView tv_club_detail_owner_right;
	private TextView tv_club_detail_owerphone_right;
	private TextView tv_club_detail_createdate_right;
	private TextView tv_club_detail_joindate_right;
	private TextView tv_club_detail_membercount_right;
	private Button btn_club_detail_apply;
	private ImageView iv_club_detail_back;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_club_detail);

		Intent i = getIntent();
		isJoin = i.getStringExtra("isJoin");	
		String clubName = i.getStringExtra("clubName");
		String clubMemberCount = i.getStringExtra("clubMemberCount");
		String clubOwner = i.getStringExtra("clubOwner");
		String clubOwnerPhone = i.getStringExtra("clubOwnerPhone");
		String clubCreateDate = i.getStringExtra("clubCreateDate");
		String clubJoinDate = i.getStringExtra("clubJoinDate");
		clubId = i.getStringExtra("clubId");
		init();//初始化
		Log.i("kevinlog", isJoin+"-"+clubName+"-"+clubMemberCount+"-"+clubOwner+"-"+clubOwnerPhone+"-"+clubCreateDate+"-"+clubJoinDate);
		
		tv_club_detail_name.setText(clubName);
		tv_club_detail_owner_right.setText(clubOwner);
		tv_club_detail_owerphone_right.setText(clubOwnerPhone);
		tv_club_detail_createdate_right.setText(clubCreateDate);
		tv_club_detail_joindate_right.setText(clubJoinDate);
		tv_club_detail_membercount_right.setText(clubMemberCount);
		btn_club_detail_apply.setText("最新活动");
	}

	private void init() {
		// TODO Auto-generated method stub
		tv_club_detail_name = (TextView) findViewById(R.id.tv_club_detail_name);
		tv_club_detail_owner_right = (TextView) findViewById(R.id.tv_club_detail_owner_right);
		tv_club_detail_owerphone_right = (TextView) findViewById(R.id.tv_club_detail_owerphone_right);
		tv_club_detail_createdate_right = (TextView) findViewById(R.id.tv_club_detail_createdate_right);
		tv_club_detail_joindate_right = (TextView) findViewById(R.id.tv_club_detail_joindate_right);
		tv_club_detail_membercount_right = (TextView) findViewById(R.id.tv_club_detail_membercount_right);
		btn_club_detail_apply = (Button) findViewById(R.id.btn_club_detail_apply);
		iv_club_detail_back = (ImageView) findViewById(R.id.iv_club_detail_back);
		
		iv_club_detail_back.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				MyClubDetailActivity.this.finish();
			}
		});
		btn_club_detail_apply.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent i = new Intent(MyClubDetailActivity.this,ClubActiveActivity.class);
				i.putExtra("clubId", clubId);
				startActivity(i);
//				CustomToast.CustomActivityToast(MyClubDetailActivity.this, "打开活动列表", 0);
			}
		});
		
	}

}
